<script src="../../js/controllers.js"></script>
<ion-view hide-nav-bar="false" class="modal slide-in-up ng-enter active ng-enter-active">


    <ion-header-bar class="index_head">
        <button class="button button-icon icon ion-android-arrow-back" ng-if="isuploadok" ui-sref="shopHome" style="color: #fff"></button>
        <button class="button button-icon icon ion-android-arrow-back" ng-if="!isuploadok" ng-click="$ionicGoBack()" style="color: #fff"></button>
        <div class="h1 title"> 产品管理</div>
        <!--<button ng-if="!sphone" class="button button-clear button-positive zhuce_head_btn" style="color: #fff;font-size: 14px;"  >添加产品</button>-->
        <!--<button ng-if="!sphone" class="button button-clear button-positive zhuce_head_btn" style="color: #fff;font-size: 14px;"  >添加产品</button>-->
    </ion-header-bar>
    <ion-content >
        <ion-refresher
                pulling-text="下拉刷新"
                refreshing-text = '正在刷新'
                on-refresh="doRefresh()">
        </ion-refresher>
        <div class="spred" style="width: 100%; height: 50px;background: #fff;" ng-if="!sphone && !isonmsg">
            <div class="ds1" ng-class="{true:'dss', false:''}[productState=='1']" ng-click="queryProduct('1')" style="float: left;height: 50px;width: 50%;line-height: 50px;text-align: center;">
               挂网
            </div>
            <!--<i style="display: block;border-right: 0.5px solid #ccc;height: 30px;margin-top: 10px;float: left;"></i>-->
            <div class="ds2" ng-class="{true:'dss', false:''}[productState=='2']" ng-click="queryProduct('2')" style="float: left;height: 50px;width : 49%;line-height: 50px;text-align: center;float: right;">

                 已下架
            </div>
        </div>
        <div class="bg-fff" ng-repeat="p in hotList2"  style="margin-top: 10px;">
            <div class="shophome-product">
                <div class="row" ng-click="product2godetail(p.proSource,p.pType, p.fpFundInfoDTO ? p.fpFundInfoDTO.id : p.productDTO.code,p.productDTO.id)">
                    <div class="col col-25 text-center shophome-product-div1" style="padding-top: 17px" ng-if="p.pType != 01">
                        <div ><span style="font-size: 20px">{{p.productDTO.profitHight.expectAnnualRevenue  | newProfitRender}}</span>
                            <span style="font-size: 12px"> {{p.productDTO.profitHight.expectAnnualRevenue  | newProfitFudongRender}}</span></div>
                        <div ng-if="p.pType !=06 ">预期收益</div>
                        <div ng-if="p.pType ==06 ">基准收益</div>
                    </div>
                    <div class="col col-25 text-center shophome-product-div1" style="padding-top: 17px" ng-if="p.pType == 01">
                        <div style="font-size: 20px;color:#f15355">{{p.fpFundInfoDTO.lsjzJson[0].zdf || '--'}}</div>
                        <div>涨跌幅</div>
                    </div>
                    <div class="col col-75 shophome-product-div2">
                        <div ng-if="p.pType != 01">{{p.productDTO.name}}</div>
                        <div ng-if="p.pType == 01"> {{p.fpFundInfoDTO.jjmc}}</div>
                        <div class="row row-no-padding shophome-product-btn" >
                            <div ng-if="p.productDTO.saleStatus && p.pType != 01">{{p.productDTO.saleStatus | getStatus}}</div>
                            <div ng-if="p.pType == 01">{{p.fpFundInfoDTO.jjzt}}</div>
                            <div>{{p.pType|getTypeName}}</div>
                            <div ng-if="p.productTag">{{p.productTag}}</div>
                        </div>
                        <div class="row row-no-padding" ng-if="p.pType != 01">
                            <div style="margin-right: 10px"><span>起投金额：</span>{{p.productDTO.minimumAmount | abbrMoney}}</div>
                            <div ng-if="p.proSource =='self'"><span>产品期限：</span> {{p.productDTO.dueTimeDes}}</div>
                            <div ng-if="p.proSource =='platform'"><span>产品期限：</span> {{p.productDTO.dueTime}}个月</div>
                        </div>
                        <div class="row row-no-padding" ng-if="p.pType == 01">
                            <div style="margin-right: 10px"><span>最新净值：</span>{{p.fpFundInfoDTO.lsjzJson[0].jzdw || '--'}}</div>
                            <div><span>基金经理：</span> {{p.fpFundInfoDTO.jjjlmc}}</div>
                        </div>
                    </div>
                </div >
                <div class="row"  ng-if="p.tuijianReson" ng-click="toView(p.pType, p.fpFundInfoDTO ? p.fpFundInfoDTO.id : p.productDTO.code)">
                    <div class="col col-25 text-center ">
                        <img class="shophome-info-img" width="50px" height="50px" ng-src="{{shopperUserInfo.userHeadImg | getUserHeadImg}}?x-oss-process=image/resize,w_750" alt="头像"/>
                    </div>
                    <div class="col col-75 shophome-product-div3">
                        <p>推荐理由{{user.avatar}}</p>
                        <div>{{p.tuijianReson}}</div>
                    </div>
                </div>
                <div ng-if="isonmsg" ng-click="addFpShopProjectInformation(p.pType, p)" class="shop-product-delete" style="margin-bottom: 0">
                    <i ng-show="item.flagShop"></i><span ng-show="item.flagShop">删除</span>
                    <i ng-show="!item.flagShop" style="background-image: url(img/shops/product-add.png)"></i><span ng-show="!item.flagShop">添加</span>
                </div>
                <div class="row w4-hot-list-top-5 product2_top6">
                    
                    <div class="col col-70 text-center pro_tab_link" ng-if="!sphone && !isonmsg">
                        <span ng-if="p.proSource =='self'" ui-sref="app.upload({id:p.productDTO.id})">
                            编辑
                        </span>
                        <span ng-if="p.proSource =='platform' && p.pType != '01'" ui-sref="productEdit({id:p.productDTO.code,type:p.pType})">
                            编辑
                        </span>
                        <span ng-if="p.proSource == 'platform' && p.pType == '01'" ui-sref="productEdit({id:p.fpFundInfoDTO.id,type:p.pType})"  >
                            编辑
                        </span>
                        <span ng-click="myupOrDownPro(p, '2')" ng-if="p.proSource == 'self' && productState=='1'">下架</span>
                        <span ng-click="upOrDownPro(p, '2')" ng-if="p.proSource == 'platform' && productState=='1'">下架</span>

                        <span ng-click="myupOrDownPro(p, '1')" ng-if="p.proSource == 'self' && productState=='2'">上架</span>
                        <span ng-click="upOrDownPro(p, '1')" ng-if="p.proSource == 'platform' && productState=='2'">上架</span>

                        <!--<span ng-if="p.proSource=='self'"  ng-click="showProdShareQrcode(p.productDTO.id, 'self')">分享</span>-->
                        <!--<span ng-if="p.pType=='01'" ng-click="showProdShareQrcode(p.fpFundInfoDTO.id, 'simu')">分享</span>-->
                        <!--<span ng-if="p.pType=='02'||p.pType=='03'||p.pType=='07'" ng-click="showProdShareQrcode(p.productDTO.code, 'xtzg')">分享</span>-->
                        <!--<span ng-if="p.pType=='06'" ng-click="showProdShareQrcode(p.productDTO.code, 'pevc')">分享</span>-->

                        <span ng-if="p.proSource=='self'"  ng-click="shopsselfshare(p.productDTO.id, p)">分享</span>
                        <span ng-if="p.pType=='01'" ng-click="simuproshare(p.fpFundInfoDTO.id, p)">分享</span>
                        <span ng-if="p.pType=='02'||p.pType=='03'||p.pType=='07'" ng-click="shopxtzgproshare(p.productDTO.code, p)">分享</span>
                        <span ng-if="p.pType=='06'" ng-click="shoppevcproshare(p.productDTO.code, p)">分享</span>
                        <span ng-if="p.proSource =='self'" ng-click="produc2del( p.productDTO.id,$event)" class="">
                        删除
                        </span>
                        <span ng-if="p.proSource =='platform' && p.pType != '01'" ng-click="productAddToShop(p.pType, p.productDTO,$event)" >
                            删除
                        </span>
                        <span  ng-if="p.proSource == 'platform' && p.pType == '01'" ng-click="productAddToShop(p.pType, p.fpFundInfoDTO,$event)" >
                            删除
                        </span>

                    </div>
                    <div class="col col-30 procode_link" ng-if="!sphone && !isonmsg">
                            <span ng-if="p.proSource=='self'"  ng-click="showProdShareQrcode(p.productDTO.id, 'self')">
                                <img src="img/commimg/pro_linkimg.png" alt="">图文推广
                            </span>
                             <span  ng-if="p.pType=='01'" ng-click="showProdShareQrcode(p.fpFundInfoDTO.id, 'simu')">
                                <img src="img/commimg/pro_linkimg.png" alt="">图文推广
                            </span>
                            <span  ng-if="p.pType=='02'||p.pType=='03'||p.pType=='07'" ng-click="showProdShareQrcode(p.productDTO.code, 'xtzg')">
                                <img src="img/commimg/pro_linkimg.png" alt="">图文推广
                            </span>
                            <span  ng-if="p.pType=='06'" ng-click="showProdShareQrcode(p.productDTO.code, 'pevc')">
                                <img src="img/commimg/pro_linkimg.png" alt="">图文推广
                            </span>
                    </div>

                </div>
            </div>


        </div>




        <div ng-show="hotList2.length <= 0" style="text-align: center; padding: 100px; color: #666;">暂无产品</div>
        <div style="height: 44px;background-color: #efeff4" ng-if="!sphone"></div>
    </ion-content>


    <div ng-if="!sphone && !isonmsg" class="row text-center  w4-xtzgDe-bottom bg-fff" style="padding: 0;height: 40px;line-height: 30px; margin-bottom: env(safe-area-inset-bottom);margin-bottom: constant(safe-area-inset-bottom);">
        <div ng-click="count_statis_btnAndPage('110501', 'app.upload', $root.shopUserPhone, null, null)"  class="col" style="background-color: #f9f9f9;color: #fe7e01;border-right: 1px solid #fff">
            <img style="vertical-align: text-top;" src="img/shops/classadd.png" width="18px" />
            添加产品
        </div>
        <div ng-click="goProAdd()"  class="col" style="background-color: #f9f9f9;color: #fe7e01">
            <img style="vertical-align: text-top;" src="img/shops/shops1.png" width="18px" />
            产品中心
        </div>
    </div>

</ion-view>